package com.quick.service;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.quick.base.KeyValue;
import com.quick.base.Page;
import com.quick.base.QueryParam;
import com.quick.base.Search;
import com.quick.sys.domain.dto.SysUserDTO;
import com.quick.sys.domain.dto.SysUserLoginDTO;
import com.quick.sys.domain.pojo.SysUser;
import com.quick.sys.domain.vo.SysUserDetailVo;
import com.quick.sys.domain.vo.SysUserVo;
import com.quick.sys.domain.vo.UserLoginVo;
import com.quick.util.QuickTool;

public interface ISysUserService {
	
	default void queryWrapper(QueryWrapper<SysUser> queryWrapper,SysUser search) {
		if(QuickTool.notNull(search.getName())) {
			queryWrapper.lambda().eq(SysUser::getName, search.getName());
		}
		if(QuickTool.notNull(search.getSex())) {
			queryWrapper.lambda().eq(SysUser::getSex, search.getSex());
		}
	}
	
    Page<SysUserVo> search(Search<SysUser> search);

    UserLoginVo userLogin(SysUserLoginDTO login);

    SysUserDetailVo getUser();
    
    Boolean loginOut();

	Boolean saveUser(SysUserDTO user);
	
	Boolean delUser(Long id);
	
	void checkUserName(String userName);

	List<KeyValue> loadSysUserAll(QueryParam search);
}
